<html>
<header>
    <title>ZZRC tech tools</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <style>
        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }
        .clearfix {
            overflow: auto;
            zoom: 1;
            display:inline-block;
            *display:inline;
            *zoom:1;
        }
        body {
            background-color: #f2f4f7;
        }
        a {
            text-decoration:none
        }
        a:hover {
            color: #ff9552;
        }
        .header {
            /*width: 100%;*/
            /*min-width: 1200px;*/
            /*min-height:40px;*/
            margin: 1px auto;
            padding: 1px;
            background-color: deepskyblue;
        }
        .header div {
            margin: 0 auto;
            text-align: center;
        }
        .main {
            /*width: 80%;*/
            /*min-width: 1200px;*/
            /*min-height:800px;*/
            /*hight:600px;*/
            margin: 0 auto;
            padding: 1px;
        }
        .footer {
            /*width: 100%;*/
            /*min-width: 1200px;*/
            /*min-height:20px;*/
            margin: 3px auto;
            padding: 1px;
            background-color: deepskyblue;
        }
        .footer div {
            margin: 10px auto;
            text-align: center;
            font-size: small;
        }
        .left {
            float: left;
            width: 20%;
            /*min-with: 250px;*/
            /*min-height: 800px;*/
        }
        .center {
            float: left;
            width: 80%;
            /*min-width: 900px;*/
            /*min-height: 800px;*/
            padding: 1px;
        }
        .left .box {
            display: inline-block;
            min-width:98%;
            margin: 6px 3px;
            background-color: #fefefe;
        }
        .center .box {
            display: inline-block;
            min-width:99%;
            min-height: 115px;
            padding: 1px;
            margin: 6px 5px;
            background-color: #fefefe;
        }
        .item {
            display: inline-block;
            width: 180px;
            text-align: left;
            margin: 6px 3px;
            padding: 2px 10px;
            background-color: #EBFFFD;
        }
        .corner {
            display: inline-block;
            width:100%;
            height: 25px;
            padding: 2px;
            margin: 1px auto;
            text-align: center;
            font-weight: bold;
            background-color: lightskyblue;
        }

    </style>
</header>
<body>
<!--    <div class="header">-->
<!--        <div>-->
<!--            <h3>ZZRC tech tools</h3>-->
<!--        </div>-->
<!--    </div>-->
    <div class="main clearfix">
        <div class="left">
            <div class="box">
                <div class="corner">
                    最近访问链接
                </div>
                <div id="common">
                </div>
            </div>
            <div class="box">
                <div class="corner">
                    办公系统
                </div>
                <div id="bangong">
                </div>
            </div>
            <div class="box">
                <div class="corner">
                    在线小工具
                </div>
                <div id="online">
                </div>
            </div>
        </div>
        <div class="center">
            <div class="box">
                <div class="corner">
                    研发工具
                </div>
                <div id="zzrc">

                </div>
            </div>
            <div class="box">
                <div class="corner">
                    RD环境
                </div>
                <div id="rd">

                </div>
            </div>
            <div class="box">
                <div class="corner">
                    QA环境
                </div>
                <div id="qa">

                </div>
            </div>
            <div class="box">
                <div class="corner">
                    SAS环境
                </div>
                <div id="sas">

                </div>
            </div>
            <div class="box">
                <div class="corner">
                    预发布
                </div>
                <div id="pre_relase">

                </div>
            </div>
            <div class="box">
                <div class="corner">
                    线上环境-国内
                </div>
                <div id="prod">

                </div>
            </div>
    
        </div>
    </div>
    <div class="footer">
        <div>
            北京众泽睿诚科技有限公司 Copyright © zzrc.tech.com
        </div>
    </div>
</body>
<script type="text/javascript">
    window.onload = function () {
        var app_map_bangong = new Map([
            ["OA", "http://oa.zz.com"],
            ["JIRA", "http://jira.zz.com"],
            ["知识库", "http://wiki.zz.com"],
            ["企业邮箱", "https://exmail.qq.com/login/"],
            ["文件共享smb://share.zz.com", ""],
            ["打印机地址", "http://192.168.0.10/"],
            
        ]);
        var app_map_online = new Map([
            ["JSON在线格式化", "https://www.json.cn/"],
            ["Unix时间戳转换工具", "http://tool.chinaz.com/Tools/unixtime.aspx"],
            ["ProcessOn作图工具", "https://www.processon.com/"],
            ["百度在线翻译", "https://fanyi.baidu.com/"],
        ]);
        var app_map_zzrc = new Map([
            ["GitLab仓库", "https://git.zz.com/"],
            ["Maven仓库", "http://maven.zz.com/"],
            ["应用API管理", "https://yapi.zz.com"],
            ["Pinpoint程序跟踪", "http://pinpoint.zz.com"],
            ["Zabbix系统监控", "http://zabbix.zz.com/"],
            ["Grafana数据展示", "https://grafana.zz.com/"],
            ["运维工具包", "http://opftp.zz.com/"],
            ["Apollo配置中心-DEV", "http://192.168.15.113:10280/"],
            ["代码质审-SQ", "http://sonar.zz.com/"], 
            ["测试专用-JKS", "http://192.168.15.111:8080/jenkins/"], 
            ["DAG数据流调度", "http://192.168.15.156/dolphinscheduler/"], 

        ]);
        var app_map_rd = new Map([
            ["Kibana日志-RD", "https://ebjlog.zz.com/"],
            ["ACL权限管理-RD", "http://ebjdev.zzrcer.com/durian/"],
            ["ACL权限管理-RDX", "http://ebjdev.zzrcer.com/acl/"],
            ["Apollo配置中心-RD", "http://ebjapo-portal.zz.com/"],
            ["后端应用Appver-RD", "https://appver.zz.com/ebjdev/peony"],
            
        ]);
        var app_map_qa = new Map([
            ["后端应用Appver-QA", "https://appver.zz.com/ebjqa/peony"],
            ["ACL权限管理-QA", "http://ebjqa.zzrcer.com:8888/acl/"],
            ["信审系统-QA", "http://ebjqa.zzrcer.com:8888/plum/"],
            ["小贷手机报表-QA", "http://ebjqa.zzrcer.com:8888/ivy/"],
            ["单点登录SSO-QA", "http://ebjsso.zzrcer.com/auth/"], 
           
        ]);
        var app_map_sas = new Map([
            ["后端应用Appver-SAS", "https://appver.zz.com/ebjsas/peony"],

        ]);
        var app_map_pre_release = new Map([
            ["后端应用Appver-PRE", "https://appver.zz.com/ebjpre/peony"],
            ["前端应用Appver-PRE", "http:/ebjpre.zzrcer.com:8888/cherry/appver.html"],

        ]);
        var app_map_release = new Map([
            ["xxx", "https://xxx"],
            
        ]);

        document.getElementById("bangong").innerHTML = init_app_item(app_map_bangong);

        document.getElementById("online").innerHTML = init_app_item(app_map_online);

        document.getElementById("zzrc").innerHTML = init_app_item(app_map_zzrc);

        document.getElementById("rd").innerHTML = init_app_item(app_map_rd);

        document.getElementById("qa").innerHTML = init_app_item(app_map_qa);

        document.getElementById("sas").innerHTML = init_app_item(app_map_sas);

        document.getElementById("pre_relase").innerHTML = init_app_item(app_map_pre_release);

        //document.getElementById("relase").innerHTML = init_app_item(app_map_release);

        refresh_common();
    }

    init_app_item = function (map) {
        var html = "";
        map.forEach(function (value, key, map) {
            html += "<div class='item'><a href='#' onclick='app_link_click_func(\""+key+"\",\""+value+"\")'>" + key + "</a></div>"
        })
        return html;
    }
    
    app_link_click_func = function (k, v) {
        var info = window.localStorage.getItem("zzrc_tools_info");
        if(info == null){
            info = k + "|" + v;
        }else{
            info = k + "|" + v + ";" + info;
        }

        var link_array = info.split(";");
        if(link_array.length > 8){
            var index = info.lastIndexOf(";");
            info = info.substring(0, index);
        }

        window.localStorage.setItem("zzrc_tools_info", info);
        window.open(v, "_blank");
        refresh_common();
    }

    refresh_common = function () {
        if(window.localStorage != null){
            var info = window.localStorage.getItem("zzrc_tools_info");
            if(info != null){
                var link_array = info.split(";");

                var map = new Map();
                for (var i = 0; i < link_array.length; i++) {
                    var tmp = link_array[i].split("|");
                    map.set(tmp[0], tmp[1]);
                }

                var html = init_app_item(map);
                document.getElementById("common").innerHTML = html;
            }
        }
    }

</script>
</html>
